/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package retrieval;

import java.util.ArrayList;
import util.FileListing;

/**
 *
 * @author Danang
 */
public class QueryTermPosition {
    private int tf;
    private ArrayList<Integer> listPosition;
    
    public QueryTermPosition() {
        listPosition = new ArrayList<Integer>();
    }
        
    public void setListPosition(ArrayList<Integer> listpos) {
        this.listPosition = listpos;
        setTf(listpos.size());
    }
    
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Tf: ").append(getTf()).append(" ");
        for (int a : getListPosition()) {
            sb.append(a).append(",");
        }
        sb.deleteCharAt(sb.length()-1);
        sb.append(FileListing.newLine);
        return sb.toString();
    }

    /**
     * @return the tf
     */
    public int getTf() {
        return tf;
    }

    /**
     * @param tf the tf to set
     */
    public void setTf(int tf) {
        this.tf = tf;
    }

    /**
     * @return the listPosition
     */
    public ArrayList<Integer> getListPosition() {
        return listPosition;
    }

}
